Make article--check-suspicious-addresses more resilient
authorLars Ingebrigtsen <larsi@gnus.org>
Thu, 20 Jan 2022 05:42:56 +0000 (06:42 +0100)
committerLars Ingebrigtsen <larsi@gnus.org>
Thu, 20 Jan 2022 05:42:56 +0000 (06:42 +0100)
* lisp/gnus/gnus-art.el (article--check-suspicious-addresses): Be
more resilient to junk in headers.  (But all this should be rewritten
eventually, because the entire process is way too convoluted.)

lisp/gnus/gnus-art.el

index d465dbfd5793b05d5fe4706d9e9eb7bd813325e5..8e46685e25f89efebc360adcf37a9c86379b4d99 100644 (file)
@@ -2659,7 +2659,8 @@ If PROMPT (the prefix), prompt for a coding system to use."
 (defun article--check-suspicious-addresses (addresses)
   (setq addresses (replace-regexp-in-string "\\`[^:]+:[ \t\n]*" "" addresses))
   (dolist (header (mail-header-parse-addresses addresses t))
-    (when-let* ((address (car (mail-header-parse-address header)))
+    (when-let* ((address (car (ignore-errors
+                                (mail-header-parse-address header))))
                 (warning (textsec-check address 'email-address)))
       (goto-char (point-min))
       (while (search-forward address nil t)